﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Data;

namespace Beacon.DataPump
{
    /*
     *  IDataPump
     *  A DataPump can accept a subscription, 
     *  any new data will send to the subscriber if it match the request
     */
    [ServiceContract(CallbackContract = typeof(IDataHandler))]
    public interface IDataPump
    {
        [OperationContract]
        void SubscribeRequest(IDataRequest request);

        [OperationContract]
        void UnSubscribeRequest();

        [OperationContract]
        void SetAttributes(DataPumpAttribute attr);

        [OperationContract]
        void PowerOn(bool off);

        [OperationContract]
        void AddData(DataRow d);

    }

    public interface IDataRequest
    {
        void Add();
    }

    public class DataPumpAttribute
    { 
    }

    public interface IData
    {
        void GetFieldValue(string fieldName);
    }

    [ServiceContract]
    interface IDataHandler
    {
        /// <summary>
        /// I just need a double value in this version.
        /// </summary>
        /// <param name="d"></param>
        [OperationContract]
        void OnDataEvent(double d);
    }
}
